<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <title>售卖机数量看板</title>
    <link rel="stylesheet" href="../../library/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.css">
    <link rel="stylesheet" href="shortAisle.css">
    <script src="../../library/jquery/jquery-1.11.3.js"></script>
    <script src="../../library/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.js"></script>
    <style>
        .selectAccess .ui-checkbox{
            display: block;
        }
        .main_list>li{
            padding:4px 0;
        }
        .title>p{
            padding: 4px 0 4px 0;
        }
        .first>p{
            padding: 8px 0;
        }
    </style>
</head>
<body>
<!--主页面-->
<div data-role="page" id="pageone">
    <div data-role="header" data-theme="a" data-position="fixed">
        <a href="index.html" target="_self" class="ui-btn ui-btn-b ui-icon-carat-l ui-btn-icon-notext" data-transition="slide" data-direction="reverse"><</a>
        <h2>缺货货道看板</h2>
    </div>
    <div data-role="main" class="ui-content">
        <div id="monMachdrill" class="draw" style="display: none"></div>
        <ul class="main_list">
            <li style="height: 2.2rem;">
                <div class="first title">
                    <p>机台编号</p>
                </div>
                <div class="first title">
                    <p>机台名称</p>
                </div>
                <div class="first title">
                    <p>缺货货道编号</p>
                </div>
            </li>
        </ul>
    </div>
</div>
<script src="../../library/Highcharts-6.0.3/highcharts.js"></script>
<script src="../../library/Highcharts-6.0.3/modules/exporting.js"></script>
<script src="../../library/Highcharts-6.0.3/modules/offline-exporting.js"></script>
<script src="../../library/vue/vue.js"></script>
<script src="../../library/vue/vue-resource.js"></script>
<script src="../../js/userId.js"></script>
<script>
    $(document).ready(function(){
        var url=window.location.href;
        var lab=decodeURI(getParamer('lab'));
        var modelsend=decodeURI(getParamer('modelSend'));
        var model=jQuery.parseJSON(modelsend);
        model.dillType=2;
        console.log(model);
        $.ajax({
            url: "http://39.107.58.193:8080/data-center/machinesBoard/getStockoutBoard?token=" + sessionStorage.getItem('userId'),
            type: "POST",
            data:{"paramData":JSON.stringify(model)},
            success:function(data){
                console.log(data);
                var str='';
                for (var i=0;i<data.data.length;i++){
                    str+='<ul class="main_list">' +
                        '<li>' +
                        '<div class="first" >' +
                        '<p>'+data.data[i].vender_no+'</p>' +
                        '</div>' +
                        '<div class="first">' +
                        '<p>'+data.data[i].vender_name+'</p>' +
                        '</div>' +
                        '<div class="first last" style="word-break: break-all;padding: 0 0px;">';
                    for (var j=0;j<data.data[i].stockout_num.length;j++){
                        str+='<span style="padding:0 3px;">'+data.data[i].stockout_num[j]+',</span>' ;
                    }
                        str+='</div>' +
                        ' </li>' +
                        '</ul>'
                }
               /* for (var i=0;i<data.data.length;i++){
                    str+='<div class="content"><ul class="nav">' +
                        '<li>'+data.data[i].vender_no+'</li>' +
                        '<li>'+data.data[i].vender_name+'</li>'+
                            '<li class="num">';
                    for (var j=0;j<data.data[i].stockout_num.length;j++){
                        str+='<p>'+data.data[i].stockout_num[j]+'</p>' ;
                    }
                       str+='</li></ul>' +
                        '</div>'
                }*/
                $(".main_list").after(str)

            }
        });

    });
    //方法获取浏览器的url中的参数
    function getParamer(paramer){
        var url=window.location.href.split("?")[1];
        if(url.indexOf("&")>0){
            urlParamArry=url.split("&");
            for(var i=0; i<urlParamArry.length; i++){
                var paramerName=urlParamArry[i].split("=");
                if(paramer==paramerName[0]){
                    return paramerName[1];
                }
            }
        }else{
            var paramerValue=url.split("=")[1];
            return paramerValue;
        }
    }
</script>
</body>
</html>